<template>
	<view class="text-26 pageYi">


		<view style="margin-top: 40rpx;">暂无收益</view>
		<!-- <view v-for="(item,index) in showYiList" @click="openItem(index)">
			<view class="flex-between" style="margin:20rpx 0;">
				<view class="flex-start">
					<image style="width:38rpx;height:16rpx;"
						src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/device/xiala@2x.png" mode="aspectFill">
					</image>
					<image style="width:32rpx;height:32rpx;margin:0 20rpx;"
						src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/device/rili@2x.png" mode="aspectFill">
					</image>
					<view>{{item.date}}</view>
				</view>
				<view>
					<text class="u-page__item__title__slot-title">收益：¥563.25</text>
				</view>
			</view>

			<view v-if="item.status">
				<view>
					<view class="shouYiHead showLine">
						<up-row justify="space-between">
							<up-col span="3" textAlign="center">
								<view>日期</view>
							</up-col>
							<up-col span="2" textAlign="center">
								<view class="overflow-text">原始金额</view>
							</up-col>
							<up-col span="2" textAlign="center">
								<view>补贴</view>
							</up-col>
							<up-col span="2" textAlign="center">
								<view class="overflow-text">SLA扣减</view>
							</up-col>
							<up-col span="3" textAlign="center">
								<view>收益</view>
							</up-col>
						</up-row>
					</view>
				</view>


				<scroll-view class="scroll-view_H flex-1" scroll-y="true">
					<up-row v-for="(son,index) in item.list"
						customStyle="height:80rpx;border-bottom:2rpx solid #1f17574d;color:#fff;">
						<up-col span="3" textAlign="center">
							<view>{{son.month}}</view>
						</up-col>
						<up-col span="2" textAlign="center">
							<view>{{son.people}}</view>
						</up-col>
						<up-col span="2" textAlign="center">
							<view>{{son.name}}</view>
						</up-col>
						<up-col span="2" textAlign="center">
							<view>{{son.money}}</view>
						</up-col>
						<up-col span="3" textAlign="center">
							<view>￥{{son.money}}</view>
						</up-col>
					</up-row>
				</scroll-view>
			</view>
		</view> -->

	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		onMounted,
		inject,
		defineProps
	} from 'vue';

	const props = defineProps({
		shouYiData: {
			type: Array,
			default: [],
		}
	})

	let imageUrl = ref("");
	onMounted(() => {
		// 全局变量引入
		const globalData = inject('globalData');
		imageUrl.value = globalData.value.imgOssUrl;
	})

	const showYiList = ref([{
		date: "2025-11-2",
		status: true,
		list: [{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 3366
			},
			{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}, {
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}
		]
	}, {
		date: "2025-11-2",
		status: false,
		list: [{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			},
			{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}, {
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}
		]
	}, {
		date: "2025-11-2",
		status: false,
		list: [{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			},
			{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}, {
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}
		]
	}, {
		date: "2025-11-2",
		status: false,
		list: [{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			},
			{
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}, {
				name: "555",
				people: "666",
				month: "2025-11",
				money: 33
			}
		]
	}])

	// 默认打开当月的明细
	const currentIndex = ref(0);

	const isShowItem = ref(false)

	// 打开月明细
	const openItem = (index) => {
		// currentIndex.value = index;


		// 改变当前的状态
		console.log("showYiList.value[index].status", showYiList.value[index].status);
		if (showYiList.value[index].status) {
			showYiList.value[index].status = false;
		} else {
			showYiList.value[index].status = true;
		}

		// 关闭其他的所有收益
		showYiList.value.forEach((ele, eleIndex) => {
			if (index !== eleIndex) {
				ele.status = false
			}
		});
	}
</script>

<style scoped>
	.pageYi /deep/ .u-cell__body {
		color: #fff !important;
		font-size: 26rpx;
	}

	.page /deep/ .u-collapse-item,
	.page /deep/ .u-cell,
	.page /deep/ .u-cell__body {
		background-color: transparent;
	}

	.page /deep/ .u-line {
		height: 0px !important;
	}

	.page /deep/ .u-collapse-item__content__text {
		padding: 10rpx 30rpx !important;
		box-sizing: border-box;
	}

	.page /deep/ .u-cell__body {
		padding: 14rpx 30rpx !important;
		box-sizing: border-box;
		border-bottom: 2rpx solid #1F1757;
	}

	.shouYiHead {
		height: 60rpx;
		line-height: 60rpx;
		background: #1F1757;
		border-radius: 12rpx 12rpx 0rpx 0rpx;
		color: #5A669E;
	}
</style>